<template>
      <div class="modal fade" id="delehealthtalk" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title" id="myModalLabel">
                {{modaltitle}}</h4>
                    </div>
                    <div class="modal-body">
                        <div class="fail cbafter" v-show="lookitem.verifyState=='2'">
                            
                            <div class="textdes">
                                <p class="nosuccess">审核未通过！</p>
                                 <p>{{lookitem.verifySuggestion}}</p>
                            </div>
                           
                        </div>
                         <div class="changeinfo cbafter">
                            <div class="changeinfo_head cbafter">
                                <span>申请人：{{username}}</span>
                                <span>申请时间：{{applytime}}</span>
                            </div>
                            <div class="cb changeinfo_con">
                                 <h3>{{lookitem.lectureTitle}} <a href="{{imgurl}}" class="{none:imgurl==''}">{{uploadfilename}}</a></h3>
                                  <p class="talktime">讲座时间：<span>{{lookitem.lectureyear}} {{lookitem.lecturetime}}</span></p>
                                  <p class="talkdoc">主讲医生：<span>{{lookitem.lectureSayerName}} {{lookitem.levelText}}</span></p>
                                  <p class="talkaddr">讲座地点：<span>{{lookitem.lectureAddr}}</span></p>
                                   <p class="talkacon">讲座内容：<span>{{lookitem.lectureContent}}</span></p>
                            </div>
                        </div>
                        <form class="form-horizontal" role="form" id="changedocform" v-on:submit.prevent="delehealthtalksave">
                            <div class="form-group">
                                <label class="col-md-3 control-label">作废理由 :</label>
                                <div class="col-md-8">
                                    <textarea class="form-control" rows="3" placeholder="请输入作废的理由" v-model="lookitem.infoDeleteReason" required></textarea  >
                                </div>
                            </div>
                            <div class="form-group save">
                                <button type="submit" class="default ok center">确认</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
</template>
<script>
import Public from 'assets/public.js'
module.exports = {
    data() {
            return {
               lookitem:{
                  lectureTitle:"",
                  lectureyear:"",
                  lecturetime:"",
                  lectureSayerName:"",
                  levelText:"",
                  lectureAddr:"",
                  verifyState:"",
                  infoDeleteReason:"",
                  verifySuggestion:"",
                  lectureContent:""
                },
            }
        },
        props: {
            "username": {
                type: String,
                default: ""
            },
             "applytime": {
                type: String,
                default: ""
            },
             "imgurl": {
                type: String,
                default: ""
            },
             "uploadfilename": {
                type: String,
                default: ""
            },
             "modaltitle": {
                type: String,
                default: ""
            },

        },
        ready() {
            var that=this;
           
        },
        methods: {
           delehealthtalk(item){
                    $("#delehealthtalk").modal("show");
                    this.modaltitle = "健康讲座作废";
                    this.username = item.infoApplyUserName;
                    this.applytime = item.infoApplyTime;
                    this.lookitem = item;
                    this.uploadfilename=item.fileName;
                      this.imgurl = Public.FILEDOWNLOAD_URL() + item.lectureAttachFile;
                },
                // 作废保存
                delehealthtalksave(){
                  var that=this;
                   $.when(Public.commonajax("coms.healthLecturesService", "deleteHelthLecture", "['" + this.lookitem.lectureId +"','"+this.lookitem.infoDeleteReason+"']"))
                        .done(function(res) {
                            if (res.code == 200) {
                               Public.ajaxPrompt("提交成功");
                               $("#delehealthtalk").modal("hide");
                                that.$dispatch('delehealthtalksave');
                            }

                        })
                },
        },
}
</script>
<style scoped>

</style>
